home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_character1.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  1.5 KB  |  68 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_CHARACTER1
  5.  
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       do
  12.      is_true('a' = 'a');
  13.      is_true('a' < 'b');
  14.      is_true('a' <= 'b');
  15.      is_true('b' <= 'b');
  16.      is_true(('a').to_upper = 'A');
  17.      is_true(('z').to_upper = 'Z');
  18.      is_true(('+').to_upper = '+');
  19.      
  20.      is_true(('A').to_lower = 'a');
  21.      is_true(('Z').to_lower = 'z');
  22.      is_true(('+').to_lower = '+');
  23.      
  24.      is_true(('0').is_digit);
  25.      is_true(('1').is_digit);
  26.      is_true(('2').is_digit);
  27.      is_true(('3').is_digit);
  28.      is_true(('4').is_digit);
  29.      is_true(('5').is_digit);
  30.      is_true(('6').is_digit);
  31.      is_true(('7').is_digit);
  32.      is_true(('8').is_digit);
  33.      is_true(('9').is_digit);
  34.      is_true(not ('x').is_digit);
  35.      
  36.      is_true(('0').value = 0);
  37.      is_true(('1').value = 1);
  38.      is_true(('2').value = 2);
  39.      is_true(('3').value = 3);
  40.      is_true(('4').value = 4);
  41.      is_true(('5').value = 5);
  42.      is_true(('6').value = 6);
  43.      is_true(('7').value = 7);
  44.      is_true(('8').value = 8);
  45.      is_true(('9').value = 9);
  46.  
  47.      is_true(('a').code = 97);
  48.      is_true(('z').code = 122);
  49.      is_true(('A').code = 65);
  50.      is_true(('Z').code = 90);
  51.       end;
  52.    
  53.    is_true(b: BOOLEAN) is
  54.       do
  55.      cpt := cpt + 1;
  56.      if not b then
  57.         std_output.put_string("TEST_CHARACTER1: ERROR Test # ");
  58.         std_output.put_integer(cpt);
  59.         std_output.put_string("%N");
  60.      else
  61.         -- std_output.put_string("Yes%N");
  62.      end;
  63.       end;
  64.    
  65.    cpt: INTEGER;
  66.    
  67. end -- TEST_CHARACTER1
  68.